package com.brillilab.service.core.kit;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.brillilab.common.entity.PageVo;
import com.brillilab.domain.enums.kit.KitEnum.Classify;
import com.brillilab.domain.pa.kit.ReagentSearchPa;
import com.brillilab.domain.pa.kit.SampleSearchPa;
import com.brillilab.domain.po.kit.Kit;
import com.brillilab.domain.vo.kit.KitInfoListVo;
import com.brillilab.domain.vo.kit.RecycleKitVo;
import com.brillilab.domain.vo.kit.SampleListVo;
import com.brillilab.domain.vo.kit.SampleVo;

/**
 * kit Service
 * @author lj
 *
 */
public interface IKitService {

	Kit insert(Kit entity);

	boolean deleteById(Long id);

	boolean updateById(Kit entity);

	Kit selectById(Long id);

	Long getKitGroup();
	/**
	 * 是否是当前所属实验室kit，不是抛出无权限提示
	 * @param token
	 * @param kitId
	 */
	void assertIsLabKit(Long labId, Long kitId);

	/**
	 * 根据fromId查询列表
	 * @param labId
	 * @param fromId
	 * @return
	 */
	List<Kit> selectListByFromId(Long labId,Long fromId);

	/**
	 * 试剂列表分页
	 * @param pa
	 * @return
	 */
	PageVo<KitInfoListVo> reagentList(ReagentSearchPa pa,Long labId,Long labMemberId);

	/**
	 * 样品列表分页
	 * @param pa
	 * @return
	 */
	PageVo<SampleListVo> sampleList(SampleSearchPa pa,Long labId,Long labMemberId);

	/**
	 * 获取删除或者未删除
	 * @return
	 */
    List<RecycleKitVo> selectByIsDelete(Long labId,Integer state);
    /**
     * 根据数据类型获取kit
     * @param labId
     * @param reagentTypeId
     * @return
     */
	List<Kit> selectListByReagentType(Long labId, Long reagentTypeId);

	/**
	 * 根据KitGroup查询样品
	 * @param kitId
	 * @return
	 */
	List<SampleVo> sampleByKitGroup(Long kitGroup);

	/**
	 * 获取kit总数量
	 * @param labId
	 * @return
	 */
	int selectKitCount(Long labId);

	/**
     * 分组统计分类下试剂数量
     * @return
     */
	Map<Long,Long> groupByReagentType(Long labId,Integer classify);
	/**
	 * 更新预警值
	 * @param kitId
	 * @return
	 */
	boolean updateWarnamount(Long kitId, BigDecimal warnamount);

	List<Kit> selectByIds(String kitIds);

	List<Kit> selectByIds(List<Long> kitIds);

	int getKitCount(Long labId,Classify classify);

    int updateAliasBatch(List<Kit> updateKit);

	/**
	 * 新建课题-试剂列表
	 * @param labId
	 * @param pageSize
	 * @param pageNum
	 * @return
	 */
	PageVo<KitInfoListVo> selectMethodReagentList(Long topicTargetId,Long topicExperimentId,Long methodTypeId,Long reagentTypeId,String search, Long labId,Integer pageSize,Integer pageNum);

    PageVo<KitInfoListVo> selectMethodReagentImportList(Long topicTargetId, Long topicExperimentId,Long methodTypeId, Long reagentTypeId, String search, Long labId, Integer pageSize, Integer pageNum);

}
